package com.snapp.web;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;

import org.puresilk.afx.base.SilkAfxServlet;

import com.snapp.util.Statics;
import com.snapp.util.factory.Factory;
import com.snapp.util.registry.Registry;


public class SNAppActionServlet extends SilkAfxServlet {
	private static final long serialVersionUID = -8415105373708325879L;

	public void init(ServletConfig config) throws ServletException {
		// become a good PSOServlet
		super.init(config);
        
		// setup logging name
		servletName = "SNAppServlet";

		// Load objects from registry
		Registry.registerObjects();

		// Load services from registry
		Registry.registerServices();
		
		// reset the factory
		Factory.reset();
		
		// Load global static repository
		Statics.load();
		
		// set up application defaults
		setDefaultNoTargetPage("/index.jsp");
		setDefaultErrorPage("/appError.jsp");
		
		// let us know we're up!
		logInfoMsg("SNAppServlet is running");

	}

}
